import { App, defineAsyncComponent } from 'vue';

export default {
    install(app, options) {
        const requireModules = import.meta.glob('../components/*/*.vue');
        for (const path in requireModules) {
            const result = path.match(/.*\/(.+)\.vue$/);
            const modulesContent = requireModules[path];
            app.component(result[1], defineAsyncComponent(modulesContent));
        }
    }
}